package com.example.yucheng.service.impl;

import com.example.yucheng.domain.Stock;
import com.example.yucheng.domain.Storage;
import com.example.yucheng.mapper.StorageMapper;
import com.example.yucheng.service.StorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StorageServiceImpl implements StorageService {
    @Autowired
    StorageMapper storageMapper;
    @Override
    public List<Storage> getStorageList(int pageNum, int pageSize) {
        List<Storage> storageList = storageMapper.getStorageList(pageNum,pageSize);
        return storageList;
    }

    @Override
    public void updateStorage(Storage storage) {
        storageMapper.updateStorage(storage);
    }

    @Override
    public void deleteStorage(int id) {
        storageMapper.deleteStorage(id);
    }

    @Override
    public void addStorage(Storage storage) {
        storageMapper.addStorage(storage);
    }

    @Override
    public Stock findGood(int gId) {
        Stock stock = storageMapper.findGood(gId);
        return stock;
    }

    @Override
    public List<Storage> getStorageSortList(int pageNum, int pageSize) {
        List<Storage> storageList = storageMapper.getStorageSortList(pageNum,pageSize);
        return storageList;
    }

    @Override
    public Storage findStorageById(int id) {
        return storageMapper.findStorageById(id);
    }

    @Override
    public List<Storage> getAllStorage() {
        return storageMapper.getAllStorage();
    }
}
